package com.seuic.hid_demo.util.ext

import java.nio.charset.Charset


/**
 * @Desc
 * @author KP
 * @date 2020/12/17 13:52
 * @version
 */


fun Byte.toHex(): String = String.format("%02x", this)

fun ByteArray.toHex(charset: Charset): String =
    map { it.toHex() }.reduce() { acc, s -> acc.plus(s) }